<?php
/**
 * 参考文献：
 *  http://imysql.com/my_cnf_generator
 *  https://tools.percona.com/wizard
 */
?>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <form method="post">
            <table>
                <tr><th>服务器内存</th><td><input type="text" name="rem_size" />GB</td></tr>
                <tr><th>服务器处理器</th><td>主频:<input type="text" name="cpu_hz" />HZ<br />核数：<input type="text" name="cpu_count" />核</td><br />位宽：<input type="radio" name="cpu_bw" value="32" />32位<input type="radio" name="cpu_bw" value="64" />64位</tr>
            <tr><th>服务器用途：</th><td><select name="server_type"><option>MySQL专用数据库服务器</option><option>多种数据库服务器</option><option>内存数据库专用服务器</option><option>网站服务器</option><option>应用服务器(高CPU负载)</option></select></td></tr>
            <tr><th>服务器托管环境：</th><td><select name="server_type"><option>专用硬件服务器</option><option>云服务器</option><option>虚拟主机</option></select></td></tr>
            <tr><th>磁盘类型：</th><td><select name="server_type"><option>普通硬盘</option><option>固态硬盘</option></select></td></tr>
            <tr><th>操作系统：</th><td><select name="server_type"><option>Linux</option><option>Windows</option></select></td></tr>
                <tr><th>MySQL版本号：</th><td><input type="text" name="" value="" /></td></tr>
                <tr><th>MySQL安装文件路径：</th><td><input type="text" name="" value="" /></td></tr>
                <tr><th>MySQL数据文件路径：</th><td><input type="text" name="" value="" /></td></tr>
                <tr><th>MySQL监听端口：</th><td><input type="text" name="" value="" /></td></tr>
                <tr><th>SOCKET文件位置：</th><td><input type="text" name="" value="" /></td></tr>
                <tr><th>预计有多少个表：</th><td><input type="text" name="" value="" /></td></tr>
                <tr><th>预计最大并发连接数： </th><td><input type="text" name="" value="" /></td></tr>
                <tr><th>排序、分组查询是否较多：</th><td><input type="radio" name="" value="" />是 (垃圾SQL真的有这么多吗?)<input type="radio" name="" value="" />否 (赞一个)</td></tr>
                <tr><th>主要存储引擎是什么：</th><td><input type="radio" name="" value="" />InnoDB (强烈推荐)<input type="radio" name="" value="" />MyISAM (强烈不推荐使用，绝大多数业务用InnoDB就足矣！)<input type="radio" name="" value="" />几乎一半一半</td></tr>
                <tr><th>事务可靠性要求级别：</th><td><input type="radio" name="" value="" />高<input type="radio" name="" value="" />中<input type="radio" name="" value="" />低</td></tr>
                <tr><th>是否需要采用InnoDB独立表空间：</th><td><input type="radio" name="" value="" />是<input type="radio" name="" value="" />否 (不方便管理，不推荐)</td></tr>
                <tr><th>是否需要开启binlog：</th><td><input type="radio" name="" value="" />是 (强烈推荐启用，紧急时可救命)<input type="radio" name="" value="" />否</td></tr>
                <tr><th>binlog专用存储目录： </th><td><input type="text" name="" /></td></tr>
                <tr><th>binlog希望最长保留几天：</th><td><input type="text" name="" />天</td></tr>
                <tr><th>单个binlog文件希望最大尺寸：</th><td><input type="text" name="" />MB</td></tr>
            </table>
        </form>
        InnoDB buffer pool:12GB
        InnoDB log files:256MB
        binary logging:yes
        thread cache:50
        key buffer:32MB
        connection limit:3000
        table cache:500
        <pre>
            # Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208
# Configuration name server-25 generated for sutroon@qq.com at 2015-09-15 03:51:13

[mysql]

# CLIENT #
port                           = 3306
socket                         = /var/lib/mysql/mysql.sock

[mysqld]

# GENERAL #
user                           = mysql
default-storage-engine         = InnoDB
socket                         = /var/lib/mysql/mysql.sock
pid-file                       = /var/lib/mysql/mysql.pid

# MyISAM #
key-buffer-size                = 32M
myisam-recover                 = FORCE,BACKUP

# SAFETY #
max-allowed-packet             = 16M
max-connect-errors             = 1000000

# DATA STORAGE #
datadir                        = /var/lib/mysql/

# BINARY LOGGING #
log-bin                        = /var/lib/mysql/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 1

# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 3000
thread-cache-size              = 100
open-files-limit               = 65535
table-definition-cache         = 4096
table-open-cache               = 256

# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 256M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 12G

# LOGGING #
log-error                      = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes  = 1
slow-query-log                 = 1
slow-query-log-file            = /var/lib/mysql/mysql-slow.log

        </pre>
    </body>
</html>
